package com.zhenhao.xsq.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.zhenhao.xsq.R;

import androidx.annotation.NonNull;


/**
 * Created by William on 2019/12/30.
 */
public class PrivateHintDialog extends Dialog implements View.OnClickListener {

    private Context mContext;
    private TextView tv_xieyi;
    private TextView tv_yingsi;
    private TextView tv_out;
    private TextView tv_in;
    private onPrivateHintDialogSelect select;

    public PrivateHintDialog(@NonNull Context context , onPrivateHintDialogSelect select) {
        this(context, 0);
        this.select = select;
    }

    public PrivateHintDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
        this.mContext = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.dialog_private_hint);

        tv_xieyi = (TextView) findViewById(R.id.tv_xieyi);
        tv_yingsi = (TextView) findViewById(R.id.tv_yingsi);
        tv_out = (TextView) findViewById(R.id.tv_out);
        tv_in = (TextView) findViewById(R.id.tv_in);

        tv_xieyi.setOnClickListener(this);
        tv_yingsi.setOnClickListener(this);
        tv_out.setOnClickListener(this);
        tv_in.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_xieyi:
                select.onPrivateHintDialogSelect("",0);
                break;
            case R.id.tv_yingsi:
                select.onPrivateHintDialogSelect("",1);
                break;
            case R.id.tv_out:
                select.onPrivateHintDialogSelect("",2);
                break;
            case R.id.tv_in:
                select.onPrivateHintDialogSelect("",3);
                break;
        }
    }

    public interface onPrivateHintDialogSelect {
        void onPrivateHintDialogSelect(String str, int position);
    }
}
